import java.util.Scanner;

public class RoomManager {
    private DormitorySystem system;

    public RoomManager(DormitorySystem system) {
        this.system = system;
    }

    // 添加房间
    public void addRoom() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入房间号: ");
        String roomNumber = scanner.next();
        System.out.print("请输入有多少床: ");
        int bedCount = scanner.nextInt();

        Room room = new Room(roomNumber, bedCount);
        system.addRoom(room);
        System.out.println(roomNumber + " 添加成功!");
    }

    // 查看房间信息
    public void viewRoomInfo() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入房间号: ");
        String roomToView = scanner.next();

        Room room = system.getRoomByNumber(roomToView);
        if (room != null) {
            room.printBedsInfo();
        } else {
            System.out.println("房间未找到");
        }
    }
}
